{% extends 'teacher/teacher_base.html' %}
{% block title %}   
<a href="#">申请课程</a> <span class="divider">/</span>  
{% endblock title %}

{% block teacherContent%}

  <div class="row-fluid">
                        <!-- block -->
                        <div class="block">
                            <div class="navbar navbar-inner block-header">
                                <div class="muted pull-left">课程信息</div>
                            </div>
                            <div class="block-content collapse in">
                                <div class="span12">
                                    
  									<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">
								     <thead>
                                            <tr>
                                                <th>序号</th>
                                                <th>课程编号</th>
                                                <th>课程名称</th>
                                                <th>上课年级</th>
                                                <th>所属学院</th>
                                                <th>学分</th>
      
       
                        
                                            </tr>
                                        </thead>
										<tbody>
											    	 {% for course in courses %}
                                               
       
                                            <tr>
                                                <td>{{ forloop.counter }}</td>
                                                <td>{{ course }}</td>
                                                <td>{{ course.courseName}}</td>
                                                <td>{{ course.CourseGrade}}</td>
                                                <td>{{ course.courseInstitute}}</td>
                                                <td>{{ course.courseCredit }}</td>
                          
                                            </tr>
                             
                                           {% endfor %}
										</tbody>
									</table>
                                </div>
                            </div>
                        </div>
                        <!-- /block -->
                    </div>
   
{% if applyCourse %}
    <div class="row-fluid">
            <div class="block">
                <div class="navbar navbar-inner block-header">
                    <div class="muted pull-left">申请课程信息</div>
                </div>
               <div class="block-content collapse in">
                    <div class="span12">
                        <table class="table table-striped">
                            <thead>
                                <tr>
                                    <th>课程编号</th>
                                    <th>课程名称</th>
                                    <th>上课年级</th>
                                    <th>所属学院</th>
                                    <th>申请进度</th>
                                    <th>申请时间</th>
                                </tr>
                            </thead>
                            <tbody>
                            	{% for course in applyCourse %}
                                <tr>
                                    <td>{{ course.teacherApplyCourse }}</td>
                                    <td>{{ course.teacherApplyCourse.courseName }}</td>
                                    <td>{{ course.teacherApplyCourse.CourseGrade }}</td>
                                    <td>{{ course.teacherApplyCourse.courseInstitute }}</td>
                                    <td>{{ course.status }}</td>
                                    <td>{{ course.applyCourseAddTime }}</td>
                                </tr>
                                {% endfor %}
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
{% endif %}
<div class="row-fluid">
	<div class="block">
    <form action="{% url 'teacherCourse' %}" method="post">
          {% csrf_token %}
          {{ form.as_p }}
      	<button name="submit" class="btn btn-primary">提交申请</button>
      </form>
    </div>
</div>
{% endblock teacherContent %}
